package com.zxjbyte.yiyi.module.system.api.oss;

import com.zxjbyte.yiyi.framework.common.constant.Constant;
import com.zxjbyte.yiyi.module.system.domain.dto.OssRecordAddDTO;
import com.zxjbyte.yiyi.module.system.domain.dto.OssRecordDelDTO;
import com.zxjbyte.yiyi.module.system.service.oss.OssRecordService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author zhangxingjia
 * @Date 2023/6/26 15:42
 * @Version: 1.0
 */
@Service
public class OssRecordApiImpl implements OssRecordApi{

    @Resource
    private OssRecordService ossRecordService;

    @Override
    @Async(Constant.DEFAULT_THREAD_POOL)
    public void asyncAdd(OssRecordAddDTO addDto) {
        ossRecordService.addRecord(addDto);
    }

    @Override
    @Async(Constant.DEFAULT_THREAD_POOL)
    public void asyncDeleteByPath(OssRecordDelDTO delDto) {
        ossRecordService.deleteByPath(delDto);
    }
}
